import { ReactDOM } from 'react'
import Head from 'next/head'
import { isServer } from '@config/env'

interface PropsInterface {
  title: string,
  children?: ReactDOM
}

export default (props: PropsInterface) => {

  if (!isServer) {
    document.title = props.title
  }

  return (
    <Head>
      <title key="title">{props.title}</title>
      <meta id="viewport" name="viewport" content="initial-scale=1.0, width=400, user-scalable=no" />
      <script src='/static/viewport-layout.js'></script>
    </Head>
  )
}
